﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PMS.EntityQuery;
using PMS.EntityManage;
using PMS.Common;
using PMS.BusinessFacade;

public partial class Modules_Personal_PerConfig : System.Web.UI.Page
{
    ISys_ConfigHandler configHandler = new Sys_ConfigManage();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            dataBind();
        }
    }

    private void dataBind()
    {
        Sys_ConfigQuery query = configHandler.GetSys_ConfigQuery(1);
        if (query != null)
        {
            txtScore.Text = query.ConfigValue;
        }
    }

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (txtScore.Text == string.Empty)
        {
            Jscript.Alert("请输入基准分数!", this.Page);
            return;
            
        }
        Sys_ConfigQuery query = configHandler.GetSys_ConfigQuery(1);
        if (query != null)
        {
            query.ConfigValue = txtScore.Text;
            if (configHandler.UpdateSys_Config(query))
            {
                Jscript.Alert("更新成功!",this.Page);
                dataBind();
            }
        }
    }
}
